import { $get, $post } from "@/http";

/**
 * @dir 登录api
 * @param { String } username
 * @param { String } password
 */
async function Login({ openId, mobile, password }) {
  return await $post("/user/login", { openId, mobile, password });
}


/**
 * @dir 注册api
 * @param { String } username
 * @param { String } password
 */
async function logon(params) {
  return await $post("/user/logon", params);
}

/**
 * @dir 查看平台客服api
 * @param { String } code
 * @param { String } financial
 * @param { String } platform_cust_ser
 */
async function getPlatformConsultant(roleCode) {
  return await $post("/user/getPlatformConsultant", roleCode);
}

/**
 * @dir 获取用户名字api
 * @param { String } code
 * @param { String } financial
 * @param { String } platform_cust_ser
 */
async function getUserName() {
  return await $post("/user/getUserName");
}

/**
 * @dir 退出登录api
 */
async function logout({ uid }) {
  return await $post("/user/logout", { uid });
}

/**
 * @dir 是否绑定微信
 */
async function isBind(code, type) {
  return await $post("/user/isBind", { code, type });
}

/**
 * @dir 查看两周内的消息api
 */
async function listInTwoWeeksMsg() {
  return await $post("/entMsgCenter/listInTwoWeeksMsg");
}
/**
 * @dir 查看两周前的消息api
 */
async function listOutTwoWeeksMsg() {
  return await $post("/entMsgCenter/listOutTwoWeeksMsg");
}
export {
  Login,
  logon,
  getPlatformConsultant,
  getUserName,
  logout,
  isBind,
  listInTwoWeeksMsg,
  listOutTwoWeeksMsg,
};
